# Sets up CMake variables for projects who link against OpendTect
#
# Copyright (C): dGB Beheer B. V. 
#
#

#Set OpendTect version
set( OpendTect_VERSION_MAJOR @OpendTect_VERSION_MAJOR@ )
set( OpendTect_VERSION_MINOR @OpendTect_VERSION_MINOR@ )
set( OpendTect_VERSION_PATCH @OpendTect_VERSION_PATCH@ )
set( OpendTect_FULL_VERSION "@OpendTect_FULL_VERSION@" )

set( QTDIR @QTDIR@ )
set( QT_VERSION_MAJOR @QT_VERSION_MAJOR@ )
set( USE_QtWebEngine @USE_QtWebEngine@ )
#Setup OpendTect's binary location (if not done)
if ( NOT DEFINED OD_BINARY_BASEDIR )
    if ( APPLE )
	set ( OD_BINARY_BASEDIR ${OpendTect_DIR}/../.. )
    else()
	set ( OD_BINARY_BASEDIR ${OpendTect_DIR} )
    endif()
endif()

#Include all OpendTect Utility macros
include( ${OpendTect_DIR}/CMakeModules/OD_SetupOD.cmake )

#Set the linker path to OpendTect's libraries
link_directories( ${OD_BINARY_BASEDIR}/${OD_LIB_OUTPUT_RELPATH} )

#As backup, link to release
set ( RELEASE_RELPATH "bin/${OD_PLFSUBDIR}/Release" )
if ( NOT ( OD_LIB_OUTPUT_RELPATH STREQUAL RELEASE_RELPATH ) )
    if ( EXISTS ${OD_BINARY_BASEDIR}/${RELEASE_RELPATH} )
	link_directories( ${OD_BINARY_BASEDIR}/${RELEASE_RELPATH} )
    endif()
endif()
unset( RELEASE_RELPATH )

#List of all modules
set( OD_CORE_MODULE_NAMES_od @OD_CORE_MODULE_NAMES_od@ )

#Includes of all modules
@MODULE_INCLUDES@

#Dependencies of all modules
@MODULE_DEPS@

set( OD_THIRD_PARTY_LIBS @OD_THIRD_PARTY_LIBS@ )
